import Mock from 'mockjs'

const tableList = []
const tableCount = 100

for (let i = 0; i < tableCount; i++) {
  tableList.push(Mock.mock({
    'roleOrder': /[a-z][A-Z][0-9]{5,10}/,
    name: '@ctitle(3, 10)',
    describe: '@cword(5, 20)',
    nowstate: '@ctitle(3, 10)',
    rolegroup: '@ctitle(3, 10)'
  }))
}

export default [
  {
    url: '/roleorg/list',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '请求成功',
        data: {
          tableList
          // ,
          // 'pageTotal|100-1000': 1000
        }
      }
    }
  },
  {
    url: '/roleOrg/getById',
    type: 'get',
    response: (req, res) => {
      return {
        code: 0,
        msg: '操作成功',
        data: {
          'roleOrder': /[a-z][A-Z][0-9]{5,10}/,
          name: '@ctitle(3, 10)',
          describe: '@cword(5, 20)',
          nowstate: '@ctitle(3, 6)',
          rolegroup: '@ctitle(3, 10)'
        }
      }
    }
  },
  {
    url: '/org/save',
    type: 'post',
    response: (req, res) => {
      return {
        code: 0,
        msg: ''
      }
    }
  }
]
